home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 43.zip / ANC 21.adf / h.doc < prev    next >
Text File  |  1988-01-19  |  5KB  |  96 lines

  1.  
  2.          ANIMBALLS - An animation hack by JimG  (Jim Guilford)
  3.  
  4.   Animballs allows one to create a collection of balls in three space
  5. and then interactively rotate them in real time. It uses HAM mode to
  6. allow for a wide range of coloring.
  7.  
  8.   To use animballs, type "animballs BallsFileName" from the CLI, where
  9. BallsFileName is the name of the file containing the description of the
  10. balls. The format of the file will be described later. A blank screen
  11. will appear with the heading of "Please Wait . . .". During this phase,
  12. some calculations are taking place. For a large or complex image, this
  13. may take a while, so be patient. After a while, the image of the balls
  14. will appear and you can start rotating them. 
  15.   You rotate them by draging with the mouse. You should press and hold
  16. the left button of the mouse. Then as you move the mouse, the image will
  17. rotate. As you move the mouse left and right, the universe will rotate
  18. around a veritcal axis (the front of the image moving towards the left
  19. or right). As you move the mouse up and down, the collection of balls
  20. will rotate around a horizontal axis (front of the object moving up or
  21. down). If you press and hold the Control key (CTRL) while you move the
  22. mouse, the direction of rotation is modified. With CTRL, moving the
  23. mouse to the right rotates the image clockwise, and to the left
  24. counterclockwise. Moving the mouse up and down with CTRL pressed has no
  25. effect.
  26.   Pressing (and holding) the shift key while dragging the mouse will
  27. slow the rotations down by a factor of 2. Pressing the Alt key will
  28. speed up the rotations by a factor of 2.
  29.   You terminate the program by left clicking on the close gadget.
  30.  
  31.   The program may also be invoked as "animballs -bw FileName". This
  32. specified black & white mode. Everything will be rendered on a black and
  33. white screen instead of a HAM screen. This will both require less memory
  34. and speed up the redisplay. For a complex scene, this may be required.
  35.  
  36.   Note that in the current implementation, the balls are rendered into a
  37. 200 by 200 screen. This means that if you move the mouse further to the
  38. right, the pointer will disappear. Don't let this worry you. It is still
  39. there, you just can't see it.
  40.  
  41.   The balls description file starts with an optional title. If the first
  42. character is an double quote ("), then everything up to the next double
  43. quote is taken as a title. If the first character is not a quote, then a
  44. default title is used. Following this are many numbers which describe
  45. the collection of balls. Each number is separated from the others by
  46. white-space (space, tab, new-line). Commas should NOT appear.
  47.   First are three numbers which describe the red, green, and blue
  48. components of the background color. These should vary from 0 to 1.
  49. Animballs will find a background color which approximates the color you
  50. give it. A future enhancement may be to exactly use the given color, but
  51. I don't feel like re-coding it now. 
  52.   Following this is the number of balls. Then a description of each ball
  53. follows. There is no significance to the order in which the balls appear.
  54. For each ball, the first three numbers are the x, y, z coordinates of
  55. the center. The center of the screen is the center of rotation, and
  56. forms the 0,0,0 point. Then comes the radius of the ball, and finally
  57. comes the r,g,b components of the ball color. Note again that there are
  58. no commas between any of the numbers.
  59.   In order to prevent the balls from rotating out of the screen, the
  60. distance to the furthest ball added to its radius should not exceed
  61. about 90. If it does, a warning will be printed, and the program will
  62. re-scale the balls to fit into the allowed space. A further enhancement
  63. might be to allow larger scenes and then clip the images, but I haven't
  64. done this.
  65.   The balls are rendered by a light source at infinity from the 1,1,1
  66. direction (right, up, out of the screen). The given color is the diffuse
  67. color. White specular highlights are added. The parameters are hard
  68. coded in the program, but may be changed if the program is to be recompiled.
  69.  
  70.                         About the code
  71.  
  72.   Feel free to use the code for any non-commercial purpose. If you make
  73. any enhancements (or have any other comments) I would appreciate hearing
  74. about them. The file "makedata.c" contains the code which generates the
  75. data.c file. It is not required for compiling animballs but is included
  76. for completeness. I wrote the code using the Lattice 4.0 C compiler. I
  77. haven't tried compiling it under Manx or the earlier Lattice compiler,
  78. but I don't do anything particularly strange, so it shouldn't be too
  79. hard to port. The only thing that may cause problems is the 
  80. #include <proto/foo> lines. If these are troublesome, they can be
  81. removed with no harm (under 4.0 they enable addition type checking and
  82. allow the library routines to be called directly from C instead of going
  83. through stubs). I compiled animballs with the following command:
  84. lc -Lf -f animballs screen hamstuff myblit data
  85. All this does is invoke the C compiler on each file and then link them.
  86. The -f and -Lf cause the Motorola Fast Floating Point routines to be
  87. used insead of the IEEE routines. This speeds up the rendering, but is
  88. not strictly required.
  89.  
  90.   Jim Guilford
  91.   225 Hoosick St.
  92.   Troy, NY  12180
  93.  
  94.   Internet:    guilford@csv.rpi.edu
  95.   uucp:        . . . rutgers!nysernic!rpics!guilford 
  96.